package com.itheima.q20210221;

import java.time.Duration;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

import static java.lang.Math.multiplyExact;

//计算出自己来到这个世界上多少天
//        tips:根据毫秒值换算
public class DateWork2 {
    public static void main(String[] args) {
        //出生日期
        LocalDateTime of = LocalDateTime.of(2000, 01, 01, 00, 00, 00);
        System.out.println(of);
        LocalDateTime now = LocalDateTime.now();
        //毫秒值差值 用duration
        Duration between = Duration.between( of,now);//小在前 大在后
        long k = between.toMillis();
        System.out.println(k);
        long v = k / 1000 /60 /60 /24/365;
        System.out.println(v);
          }
}
